package UnitTest.AlgorithmTest.combineTest.sumofSubSequenceTest.LMGTest;

import Algorithm.comprehensive.sumofSubSequence.LMG.ThiefSteal2;
import org.junit.Test;

/**
 * @author liujun
 * @version 1.0
 * @date 2021/1/26
 * @author—Email liujunfirst@outlook.com
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 打家劫舍2 测试案例
 */
public class ThiefSteal2Test {

    ThiefSteal2 thiefSteal2 = new ThiefSteal2();

    @Test
    public void test() {
        int taregt = thiefSteal2.method(demo00);
        assert taregt == 0;
        taregt = thiefSteal2.method(demo01);
        assert taregt == 210;
        taregt = thiefSteal2.method(demo02);
        assert taregt == 30;
        taregt = thiefSteal2.method(demo03);
        assert taregt == 210;
        taregt = thiefSteal2.method(demo04);
        assert taregt == 105;
        taregt = thiefSteal2.method(demo05);
        assert taregt == 105;
        taregt = thiefSteal2.method(demo06);
        assert taregt == 630;
        taregt = thiefSteal2.method(demo07);
        assert taregt == 126;
        taregt = thiefSteal2.method(demo08);
        assert taregt == -5;
        taregt = thiefSteal2.method(demo09);
        assert taregt == 2;
        taregt = thiefSteal2.method(demo10);
        assert taregt == 30;
        taregt = thiefSteal2.method(demo101);
        assert taregt == 2;
        taregt = thiefSteal2.method(demo11);
        assert taregt == 30;
        taregt = thiefSteal2.method(demo12);
        assert taregt == 90;
        taregt = thiefSteal2.method(demo13);
        assert taregt == 30;
        taregt = thiefSteal2.method(demo14);
        assert taregt == 126;
        taregt = thiefSteal2.method(demo15);
        assert taregt == 630;
        taregt = thiefSteal2.method(demo16);
        assert taregt == 630;
        taregt = thiefSteal2.method(demo17);
        assert taregt == 630;
    }

    int[] demo00 = {};                        //0
    int[] demo01 = {5, 2, 6, 3, 1, 7};        //210
    int[] demo02 = {5, 2, 6, 3, 1, -7};       //30
    int[] demo03 = {5, 2, -6, 3, 1, -7};      //210
    int[] demo04 = {5, 2, -6, 3, 1, 7};       //105
    int[] demo05 = {5, 2, -6, 0, 3, 1, 7};    //105
    int[] demo06 = {-5, 2, -6, 0, 3, 1, 7};   //630
    int[] demo07 = {-5, 2, -6, 0, 3, 1, -7};  //126
    int[] demo08 = {-5};                      //-5
    int[] demo09 = {-5, 2};                   //2
    int[] demo10 = {-5, 2, -6};               //30
    int[] demo101 = {-5, -6, 2};              //2
    int[] demo11 = {-5, 2, -6, 0};            //30
    int[] demo12 = {-5, 2, -6, 0, 3};         //90
    int[] demo13 = {-5, 2, -6, 0, -3};        //30
    int[] demo14 = {-5, 0, -6, 0, 3, 0, -7};  //126
    int[] demo15 = {-5, 0, -6, 0, -3, 0, -7}; //630
    int[] demo16 = {-5, 1, -6, 0, -3, 0, -7}; //630
    int[] demo17 = {-5, -1, -6, 0, -3, 0, -7};//630
}
